package com.mybatisflex.demo.keygen;

import com.mybatisflex.core.keygen.IKeyGenerator;

import java.security.SecureRandom;

/**
 * @author 王帅
 * @since 2023-07-26
 */
public class HashCodeKeyGenerator implements IKeyGenerator {

    @Override
    public Object generate(Object entity, String keyColumn) {
        return entity.hashCode() + new SecureRandom().nextInt();
    }

}